/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.openbrew.openbrewrf;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author chapmand
 */
@Entity
@Table(name = "BoilHops")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BoilHops.findAll", query = "SELECT b FROM BoilHops b"),
    @NamedQuery(name = "BoilHops.findByBoilHopsID", query = "SELECT b FROM BoilHops b WHERE b.boilHopsID = :boilHopsID"),
    @NamedQuery(name = "BoilHops.findByBoilHopMinutes", query = "SELECT b FROM BoilHops b WHERE b.boilHopMinutes = :boilHopMinutes"),
    @NamedQuery(name = "BoilHops.findByBoilHopLbs", query = "SELECT b FROM BoilHops b WHERE b.boilHopLbs = :boilHopLbs"),
    @NamedQuery(name = "BoilHops.findByBoilHopFWH", query = "SELECT b FROM BoilHops b WHERE b.boilHopFWH = :boilHopFWH")})
public class BoilHops implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "boilHopsID")
    private Integer boilHopsID;
    @Basic(optional = false)
    @NotNull
    @Column(name = "boilHopMinutes")
    private float boilHopMinutes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "boilHopLbs")
    private float boilHopLbs;
    @Basic(optional = false)
    @NotNull
    @Column(name = "boilHopFWH")
    private boolean boilHopFWH;
    @JoinColumn(name = "hopID", referencedColumnName = "HID", nullable=true)
    @ManyToOne(optional = true)
    private Hops hopID;

    public BoilHops() {
    }

    public BoilHops(Integer boilHopsID) {
        this.boilHopsID = boilHopsID;
    }

    public BoilHops(Integer boilHopsID, float boilHopMinutes, float boilHopLbs, boolean boilHopFWH) {
        this.boilHopsID = boilHopsID;
        this.boilHopMinutes = boilHopMinutes;
        this.boilHopLbs = boilHopLbs;
        this.boilHopFWH = boilHopFWH;
    }

    public Integer getBoilHopsID() {
        return boilHopsID;
    }

    public void setBoilHopsID(Integer boilHopsID) {
        this.boilHopsID = boilHopsID;
    }

    public float getBoilHopMinutes() {
        return boilHopMinutes;
    }

    public void setBoilHopMinutes(float boilHopMinutes) {
        this.boilHopMinutes = boilHopMinutes;
    }

    public float getBoilHopLbs() {
        return boilHopLbs;
    }

    public void setBoilHopLbs(float boilHopLbs) {
        this.boilHopLbs = boilHopLbs;
    }

    public boolean getBoilHopFWH() {
        return boilHopFWH;
    }

    public void setBoilHopFWH(boolean boilHopFWH) {
        this.boilHopFWH = boilHopFWH;
    }

    public Hops getHopID() {
        return hopID;
    }

    public void setHopID(Hops hopID) {
        this.hopID = hopID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (boilHopsID != null ? boilHopsID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BoilHops)) {
            return false;
        }
        BoilHops other = (BoilHops) object;
        if ((this.boilHopsID == null && other.boilHopsID != null) || (this.boilHopsID != null && !this.boilHopsID.equals(other.boilHopsID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.openbrew.openbrewrf.BoilHops[ boilHopsID=" + boilHopsID + " ]";
    }
    
}
